package zuoye722;

import java.awt.List;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map.Entry;

public class demo5 {
    public static void main(String[] args) {
	HashMap<Integer,Integer> map=new HashMap<>();
    int[] arr1={1,2,3};
    int[] arr2={3,4,5,2};
    int[] newarr=new int[arr1.length+arr2.length];
    System.arraycopy(arr1, 0, newarr, 0, arr1.length);
    System.arraycopy(arr2, 0, newarr, arr1.length, arr2.length);
    for(int narr:newarr){
    	System.out.print(narr+" ");
    }
   System.out.println(" ");
    for(int a:newarr){
    	if(map.containsKey(a)){
    		int count=map.get(a);
    		map.put(a, count+1);
    	}else{
    		map.put(a, 1);
    	}
    }
    System.out.println(map);
    for(Entry<Integer, Integer> entry: map.entrySet()){
		if(entry.getValue()==1){
			System.out.print(entry.getKey()+" ");	 
		}
	}
    
    }
}
